package com.mysite.seckill.web.mapper;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;

import com.mysite.seckill.commons.po.SeckillActivity;
import com.mysite.seckill.commons.vo.SeckillActivityVo;

@Mapper
public interface SeckillActivityMapper {

    @Insert("INSERT INTO seckill_activity(sn, activity_quota, product_id, seckill_price, seckill_max_count, start_time) VALUES (#{sn}, #{activityQuota}, #{productId}, #{seckillPrice}, #{seckillMaxCount}, #{startTime})")
    @Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
    public int insertSeckillActivity(SeckillActivity activity);

    public Integer selectActivityCount(Map<String, Object> searchMap);

    public List<SeckillActivityVo> selectActivities(Map<String, Object> searchMap);
}
